#! /usr/bin/env python
# encoding: utf-8

"""Installs Spyro in the current environment.
Type `python setup.py install` to start the installation.
"""

from setuptools import setup, find_packages

class Installer:
    # status code
    STABLE = 0
    RC     = 1
    BETA   = 2
    ALPHA  = 3
    
    @classmethod
    def run(cls):
        version = "0.9a2" # update THIS
        status = cls.ALPHA # update THIS
        
        if status > cls.STABLE:
            print("You are about to install an UNSTABLE version of Spyro.")
            answer = str(input("Are you sure? (y/n): "))
            
            if (answer == 'n' or answer == 'no') or\
               (answer != 'y' and answer != 'yes'):
                print("Aborting...")
                exit()
        
        setup(name='Spyro',
              version=version,
              author='Alessandro Agosto',
              author_email='lexmlist@gmail.com',
              description='Python web-framework for python3 environments.',
              license='BSD',
              packages=find_packages(exclude=['bin', 'misc', 'examples',
                                              'tests']),
              install_requires=['PyYAML', 'Jinja2>=2.5'],
              scripts=['bin/spyrodev']
             )

if __name__ == '__main__':
    Installer.run()
